\hypertarget{classduye_1_1_xml_document}{\section{duye\-:\-:Xml\-Document Class Reference}
\label{classduye_1_1_xml_document}\index{duye\-::\-Xml\-Document@{duye\-::\-Xml\-Document}}
}


Always the top level node. A document binds together all the X\-M\-L pieces. It can be saved, loaded, and printed to the screen. The 'value' of a document node is the xml file name.  




{\ttfamily \#include $<$duye\-\_\-xml.\-h$>$}

Inheritance diagram for duye\-:\-:Xml\-Document\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classduye_1_1_xml_document}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classduye_1_1_xml_document_a34456a0c325c4a8ac82133c29bf674ac}{\hyperlink{classduye_1_1_xml_document_a34456a0c325c4a8ac82133c29bf674ac}{Xml\-Document} ()}\label{classduye_1_1_xml_document_a34456a0c325c4a8ac82133c29bf674ac}

\begin{DoxyCompactList}\small\item\em Create an empty document, that has no name. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_a3b88c0c1d13fcad94c319df893c010cd}{\hyperlink{classduye_1_1_xml_document_a3b88c0c1d13fcad94c319df893c010cd}{Xml\-Document} (const char $\ast$document\-Name)}\label{classduye_1_1_xml_document_a3b88c0c1d13fcad94c319df893c010cd}

\begin{DoxyCompactList}\small\item\em Create a document with a name. The name of the document is also the filename of the xml. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_a87f14925bd5c1f82a4baa48a290dda32}{\hyperlink{classduye_1_1_xml_document_a87f14925bd5c1f82a4baa48a290dda32}{Xml\-Document} (const std\-::string \&document\-Name)}\label{classduye_1_1_xml_document_a87f14925bd5c1f82a4baa48a290dda32}

\begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_a9067877c58e0083bac43468ac02a1a55}{{\bfseries Xml\-Document} (const \hyperlink{classduye_1_1_xml_document}{Xml\-Document} \&copy)}\label{classduye_1_1_xml_document_a9067877c58e0083bac43468ac02a1a55}

\item 
\hypertarget{classduye_1_1_xml_document_aa055cf2bf70344d08267869f402a8ff0}{\hyperlink{classduye_1_1_xml_document}{Xml\-Document} \& {\bfseries operator=} (const \hyperlink{classduye_1_1_xml_document}{Xml\-Document} \&copy)}\label{classduye_1_1_xml_document_aa055cf2bf70344d08267869f402a8ff0}

\item 
\hypertarget{classduye_1_1_xml_document_a8694e2e47962f6e0674a9a248ef1a1be}{bool \hyperlink{classduye_1_1_xml_document_a8694e2e47962f6e0674a9a248ef1a1be}{load\-File} (Xml\-Encoding encoding=X\-M\-L\-\_\-\-D\-E\-F\-A\-U\-L\-T\-\_\-\-E\-N\-C\-O\-D\-I\-N\-G)}\label{classduye_1_1_xml_document_a8694e2e47962f6e0674a9a248ef1a1be}

\begin{DoxyCompactList}\small\item\em Load a file using the current document value. Returns true if successful. Will delete any existing document data before loading. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_af955f3ca14139f1b104bedcb52be2e9c}{bool \hyperlink{classduye_1_1_xml_document_af955f3ca14139f1b104bedcb52be2e9c}{save\-File} () const }\label{classduye_1_1_xml_document_af955f3ca14139f1b104bedcb52be2e9c}

\begin{DoxyCompactList}\small\item\em Save a file using the current document value. Returns true if successful. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_a92882b07ff0f2eb590b2acaefc16065a}{bool \hyperlink{classduye_1_1_xml_document_a92882b07ff0f2eb590b2acaefc16065a}{load\-File} (const char $\ast$filename, Xml\-Encoding encoding=X\-M\-L\-\_\-\-D\-E\-F\-A\-U\-L\-T\-\_\-\-E\-N\-C\-O\-D\-I\-N\-G)}\label{classduye_1_1_xml_document_a92882b07ff0f2eb590b2acaefc16065a}

\begin{DoxyCompactList}\small\item\em Load a file using the given filename. Returns true if successful. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_a59d28e04d55841b49012fdae06083a2c}{bool \hyperlink{classduye_1_1_xml_document_a59d28e04d55841b49012fdae06083a2c}{save\-File} (const char $\ast$filename) const }\label{classduye_1_1_xml_document_a59d28e04d55841b49012fdae06083a2c}

\begin{DoxyCompactList}\small\item\em Save a file using the given filename. Returns true if successful. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_a795fa80204ae398850cbf92ad57ab8e0}{bool \hyperlink{classduye_1_1_xml_document_a795fa80204ae398850cbf92ad57ab8e0}{load\-File} (F\-I\-L\-E $\ast$file, Xml\-Encoding encoding=X\-M\-L\-\_\-\-D\-E\-F\-A\-U\-L\-T\-\_\-\-E\-N\-C\-O\-D\-I\-N\-G)}\label{classduye_1_1_xml_document_a795fa80204ae398850cbf92ad57ab8e0}

\begin{DoxyCompactList}\small\item\em Load a file using the given F\-I\-L\-E$\ast$. Returns true if successful. Note that this method doesn't stream -\/ the entire object pointed at by the F\-I\-L\-E$\ast$ will be interpreted as an X\-M\-L file. Gny\-X\-M\-L doesn't stream in X\-M\-L from the current file location. Streaming may be added in the future. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_a56b4ac8c9dfd6a4071cf1630ed0a458e}{bool {\bfseries load} (const char $\ast$content, const unsigned int length, Xml\-Encoding encoding=X\-M\-L\-\_\-\-D\-E\-F\-A\-U\-L\-T\-\_\-\-E\-N\-C\-O\-D\-I\-N\-G)}\label{classduye_1_1_xml_document_a56b4ac8c9dfd6a4071cf1630ed0a458e}

\item 
bool \hyperlink{classduye_1_1_xml_document_a8e022ad0b78af4b3229a96c0bd328477}{save\-File} (F\-I\-L\-E $\ast$file) const 
\begin{DoxyCompactList}\small\item\em Save a file using the given F\-I\-L\-E$\ast$. Returns true if successful. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_aa226d1946072c480679c380f8171ca23}{bool \hyperlink{classduye_1_1_xml_document_aa226d1946072c480679c380f8171ca23}{load\-File} (const std\-::string \&filename, Xml\-Encoding encoding=X\-M\-L\-\_\-\-D\-E\-F\-A\-U\-L\-T\-\_\-\-E\-N\-C\-O\-D\-I\-N\-G)}\label{classduye_1_1_xml_document_aa226d1946072c480679c380f8171ca23}

\begin{DoxyCompactList}\small\item\em S\-T\-L std\-::string version. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_ad3ba526d29b0c40aaa0e3164214d9510}{bool {\bfseries save\-File} (const std\-::string \&filename) const }\label{classduye_1_1_xml_document_ad3ba526d29b0c40aaa0e3164214d9510}

\item 
\hypertarget{classduye_1_1_xml_document_a06405104fc28af5dbe7eb55c5b4a9959}{virtual const char $\ast$ \hyperlink{classduye_1_1_xml_document_a06405104fc28af5dbe7eb55c5b4a9959}{parse} (const char $\ast$p, Xml\-Parsing\-Data $\ast$data=0, Xml\-Encoding encoding=X\-M\-L\-\_\-\-D\-E\-F\-A\-U\-L\-T\-\_\-\-E\-N\-C\-O\-D\-I\-N\-G)}\label{classduye_1_1_xml_document_a06405104fc28af5dbe7eb55c5b4a9959}

\begin{DoxyCompactList}\small\item\em Parse the given null terminated block of xml data. Passing in an encoding to this method (either X\-M\-L\-\_\-\-E\-N\-C\-O\-D\-I\-N\-G\-\_\-\-L\-E\-G\-A\-C\-Y or X\-M\-L\-\_\-\-E\-N\-C\-O\-D\-I\-N\-G\-\_\-\-U\-T\-F8 will force Xml to use that encoding, regardless of what Gny\-Xml might otherwise try to detect. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_aad4b38c2ad297cace9e46c4c46bcf122}{const \hyperlink{classduye_1_1_xml_element}{Xml\-Element} $\ast$ \hyperlink{classduye_1_1_xml_document_aad4b38c2ad297cace9e46c4c46bcf122}{root\-Element} () const }\label{classduye_1_1_xml_document_aad4b38c2ad297cace9e46c4c46bcf122}

\begin{DoxyCompactList}\small\item\em Get the root element -- the only top level element -- of the document. In well formed X\-M\-L, there should only be one. Gny\-Xml is tolerant of multiple elements at the document level. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_af0d77f7ef810c667780f4a525a5ae1ec}{\hyperlink{classduye_1_1_xml_element}{Xml\-Element} $\ast$ {\bfseries root\-Element} ()}\label{classduye_1_1_xml_document_af0d77f7ef810c667780f4a525a5ae1ec}

\item 
bool \hyperlink{classduye_1_1_xml_document_a4696daf7d7cefa47310256cb0a3c3385}{error} () const 
\begin{DoxyCompactList}\small\item\em If an error occurs, \hyperlink{classduye_1_1_error}{Error} will be set to true. Also,. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_a7b716506c42ec95ae6ef3dae33e9ca4d}{const char $\ast$ \hyperlink{classduye_1_1_xml_document_a7b716506c42ec95ae6ef3dae33e9ca4d}{error\-Desc} () const }\label{classduye_1_1_xml_document_a7b716506c42ec95ae6ef3dae33e9ca4d}

\begin{DoxyCompactList}\small\item\em Contains a textual (english) description of the error if one occurs. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_a39bb4dcbc505fdc0f4136a70e7445e5f}{int \hyperlink{classduye_1_1_xml_document_a39bb4dcbc505fdc0f4136a70e7445e5f}{error\-Id} () const }\label{classduye_1_1_xml_document_a39bb4dcbc505fdc0f4136a70e7445e5f}

\begin{DoxyCompactList}\small\item\em Generally, you probably want the error string ( Error\-Desc() ). But if you prefer the Error\-Id, this function will fetch it. \end{DoxyCompactList}\item 
int \hyperlink{classduye_1_1_xml_document_a74a198fef33079be41c63932b8291040}{error\-Row} () const 
\begin{DoxyCompactList}\small\item\em Returns the location (if known) of the error. The first column is column 1, and the first row is row 1. A value of 0 means the row and column wasn't applicable (memory errors, for example, have no row/column) or the parser lost the error. (An error in the error reporting, in that case.) \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_a2530c47c7d55c7ac67e950486db7f0d6}{int {\bfseries error\-Col} () const }\label{classduye_1_1_xml_document_a2530c47c7d55c7ac67e950486db7f0d6}

\item 
void \hyperlink{classduye_1_1_xml_document_ac7ccceb858268826e7fa0881dc58eb92}{set\-Tab\-Size} (int tabsize)
\begin{DoxyCompactList}\small\item\em Set\-Tab\-Size() allows the error reporting functions (Error\-Row() and Error\-Col()) to report the correct values for row and column. It does not change the output or input in any way. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_a228151f693cc1fa877b48db814409af9}{int {\bfseries tab\-Size} () const }\label{classduye_1_1_xml_document_a228151f693cc1fa877b48db814409af9}

\item 
\hypertarget{classduye_1_1_xml_document_aa975cc3de7922148edd660061f2b1a0b}{void \hyperlink{classduye_1_1_xml_document_aa975cc3de7922148edd660061f2b1a0b}{clear\-Error} ()}\label{classduye_1_1_xml_document_aa975cc3de7922148edd660061f2b1a0b}

\begin{DoxyCompactList}\small\item\em If you have handled the error, it can be reset with this call. The error state is automatically cleared if you Parse a new X\-M\-L block. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_a917ed1f54091413286a0d8f2900b9dca}{void {\bfseries print} () const }\label{classduye_1_1_xml_document_a917ed1f54091413286a0d8f2900b9dca}

\item 
\hypertarget{classduye_1_1_xml_document_af3d655a3a2f670c4bbec984d83354fda}{void {\bfseries xml\-To\-Str} (std\-::string \&out\-Xml) const }\label{classduye_1_1_xml_document_af3d655a3a2f670c4bbec984d83354fda}

\item 
virtual void \hyperlink{classduye_1_1_xml_document_a6e47f2b7dc26ead234b5d6672fdebbf1}{print} (F\-I\-L\-E $\ast$cfile, int depth=0) const 
\begin{DoxyCompactList}\small\item\em Write the document to a string using formatted printing (\char`\"{}pretty print\char`\"{}). This will allocate a character array (new char\mbox{[}\mbox{]}) and return it as a pointer. The calling code pust call delete\mbox{[}\mbox{]} on the return char$\ast$ to avoid a memory leak. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_a8e7591c46972cc8679a3c20e3c56791e}{void {\bfseries xml\-To\-Str} (std\-::string \&out\-Xml, int depth) const }\label{classduye_1_1_xml_document_a8e7591c46972cc8679a3c20e3c56791e}

\item 
\hypertarget{classduye_1_1_xml_document_acca31bd965a48f9a8dfbb7b33c4f14be}{void \hyperlink{classduye_1_1_xml_document_acca31bd965a48f9a8dfbb7b33c4f14be}{set\-Error} (int err, const char $\ast$error\-Location, Xml\-Parsing\-Data $\ast$prev\-Data, Xml\-Encoding encoding)}\label{classduye_1_1_xml_document_acca31bd965a48f9a8dfbb7b33c4f14be}

\begin{DoxyCompactList}\small\item\em Cast to a more defined type. Will return null not of the requested type. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_a2a7371581ef15a4ba23b03d24e8c0fd5}{virtual const \hyperlink{classduye_1_1_xml_document}{Xml\-Document} $\ast$ \hyperlink{classduye_1_1_xml_document_a2a7371581ef15a4ba23b03d24e8c0fd5}{to\-Document} () const }\label{classduye_1_1_xml_document_a2a7371581ef15a4ba23b03d24e8c0fd5}

\begin{DoxyCompactList}\small\item\em Cast to a more defined type. Will return null not of the requested type. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_ae746e171e5611e9557fa4a3747393821}{virtual \hyperlink{classduye_1_1_xml_document}{Xml\-Document} $\ast$ \hyperlink{classduye_1_1_xml_document_ae746e171e5611e9557fa4a3747393821}{to\-Document} ()}\label{classduye_1_1_xml_document_ae746e171e5611e9557fa4a3747393821}

\begin{DoxyCompactList}\small\item\em Cast to a more defined type. Will return null if not of the requested type. \end{DoxyCompactList}\item 
virtual bool \hyperlink{classduye_1_1_xml_document_a6362b1d0f171301a19d36e7fc541f85c}{accept} (\hyperlink{classduye_1_1_xml_visitor}{Xml\-Visitor} $\ast$content) const 
\begin{DoxyCompactList}\small\item\em Accept a hierchical visit the nodes in the Gny\-X\-M\-L D\-O\-M. Every node in the X\-M\-L tree will be conditionally visited and the host will be called back via the \hyperlink{classduye_1_1_xml_visitor}{Xml\-Visitor} interface. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classduye_1_1_xml_document_aa4fbc0fe876ebaeb51e9d6a6a1132410}{virtual \hyperlink{classduye_1_1_xml_node}{Xml\-Node} $\ast$ \hyperlink{classduye_1_1_xml_document_aa4fbc0fe876ebaeb51e9d6a6a1132410}{clone} () const }\label{classduye_1_1_xml_document_aa4fbc0fe876ebaeb51e9d6a6a1132410}

\begin{DoxyCompactList}\small\item\em Create an exact duplicate of this node and return it. The memory must be deleted by the caller. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_document_aab1ddd5dce2447b4375a871d44124928}{virtual void {\bfseries stream\-In} (std\-::istream $\ast$in, std\-::string $\ast$tag)}\label{classduye_1_1_xml_document_aab1ddd5dce2447b4375a871d44124928}

\end{DoxyCompactItemize}
\subsection*{Additional Inherited Members}


\subsection{Detailed Description}
Always the top level node. A document binds together all the X\-M\-L pieces. It can be saved, loaded, and printed to the screen. The 'value' of a document node is the xml file name. 

\subsection{Member Function Documentation}
\hypertarget{classduye_1_1_xml_document_a6362b1d0f171301a19d36e7fc541f85c}{\index{duye\-::\-Xml\-Document@{duye\-::\-Xml\-Document}!accept@{accept}}
\index{accept@{accept}!duye::XmlDocument@{duye\-::\-Xml\-Document}}
\subsubsection[{accept}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool duye\-::\-Xml\-Document\-::accept (
\begin{DoxyParamCaption}
\item[{{\bf Xml\-Visitor} $\ast$}]{visitor}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [virtual]}}}\label{classduye_1_1_xml_document_a6362b1d0f171301a19d36e7fc541f85c}


Accept a hierchical visit the nodes in the Gny\-X\-M\-L D\-O\-M. Every node in the X\-M\-L tree will be conditionally visited and the host will be called back via the \hyperlink{classduye_1_1_xml_visitor}{Xml\-Visitor} interface. 

This is essentially a S\-A\-X interface for Gny\-X\-M\-L. (Note however it doesn't re-\/parse the X\-M\-L for the callbacks, so the performance of Gny\-X\-M\-L is unchanged by using this interface versus any other.)

The interface has been based on ideas from\-:


\begin{DoxyItemize}
\item \href{http://www.saxproject.org/}{\tt http\-://www.\-saxproject.\-org/}
\item \href{http://c2.com/cgi/wiki?HierarchicalVisitorPattern}{\tt http\-://c2.\-com/cgi/wiki?\-Hierarchical\-Visitor\-Pattern}
\end{DoxyItemize}

Which are both good references for \char`\"{}visiting\char`\"{}.

An example of using Accept()\-: \begin{DoxyVerb}* GXmlPrinter printer;\
* tinyxmlDoc.Accept( &printer );
* const char* xmlcstr = printer.CStr();
* \end{DoxyVerb}
 

Implements \hyperlink{classduye_1_1_xml_node_adcd11cb01e35ea4f9e11c3e451a132f3}{duye\-::\-Xml\-Node}.

\hypertarget{classduye_1_1_xml_document_a4696daf7d7cefa47310256cb0a3c3385}{\index{duye\-::\-Xml\-Document@{duye\-::\-Xml\-Document}!error@{error}}
\index{error@{error}!duye::XmlDocument@{duye\-::\-Xml\-Document}}
\subsubsection[{error}]{\setlength{\rightskip}{0pt plus 5cm}bool duye\-::\-Xml\-Document\-::error (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classduye_1_1_xml_document_a4696daf7d7cefa47310256cb0a3c3385}


If an error occurs, \hyperlink{classduye_1_1_error}{Error} will be set to true. Also,. 


\begin{DoxyItemize}
\item The Error\-Id() will contain the integer identifier of the error (not generally useful)
\item The Error\-Desc() method will return the name of the error. (very useful)
\item The Error\-Row() and Error\-Col() will return the location of the error (if known) 
\end{DoxyItemize}\hypertarget{classduye_1_1_xml_document_a74a198fef33079be41c63932b8291040}{\index{duye\-::\-Xml\-Document@{duye\-::\-Xml\-Document}!error\-Row@{error\-Row}}
\index{error\-Row@{error\-Row}!duye::XmlDocument@{duye\-::\-Xml\-Document}}
\subsubsection[{error\-Row}]{\setlength{\rightskip}{0pt plus 5cm}int duye\-::\-Xml\-Document\-::error\-Row (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classduye_1_1_xml_document_a74a198fef33079be41c63932b8291040}


Returns the location (if known) of the error. The first column is column 1, and the first row is row 1. A value of 0 means the row and column wasn't applicable (memory errors, for example, have no row/column) or the parser lost the error. (An error in the error reporting, in that case.) 

\begin{DoxySeeAlso}{See Also}
Set\-Tab\-Size, Row, Column\-The \hyperlink{classduye_1_1_xml_base_a2fe47c66f1c19b535d7a935e906654c0}{column} where the \hyperlink{classduye_1_1_xml_document_a4696daf7d7cefa47310256cb0a3c3385}{error} occured. See Error\-Row() 
\end{DoxySeeAlso}
\hypertarget{classduye_1_1_xml_document_a6e47f2b7dc26ead234b5d6672fdebbf1}{\index{duye\-::\-Xml\-Document@{duye\-::\-Xml\-Document}!print@{print}}
\index{print@{print}!duye::XmlDocument@{duye\-::\-Xml\-Document}}
\subsubsection[{print}]{\setlength{\rightskip}{0pt plus 5cm}virtual void duye\-::\-Xml\-Document\-::print (
\begin{DoxyParamCaption}
\item[{F\-I\-L\-E $\ast$}]{cfile, }
\item[{int}]{depth = {\ttfamily 0}}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [virtual]}}}\label{classduye_1_1_xml_document_a6e47f2b7dc26ead234b5d6672fdebbf1}


Write the document to a string using formatted printing (\char`\"{}pretty print\char`\"{}). This will allocate a character array (new char\mbox{[}\mbox{]}) and return it as a pointer. The calling code pust call delete\mbox{[}\mbox{]} on the return char$\ast$ to avoid a memory leak. 

Print this Document to a F\-I\-L\-E stream. 

Implements \hyperlink{classduye_1_1_xml_base_aeb28d8aeec84aad3ce290c6cc3a5ec06}{duye\-::\-Xml\-Base}.

\hypertarget{classduye_1_1_xml_document_a8e022ad0b78af4b3229a96c0bd328477}{\index{duye\-::\-Xml\-Document@{duye\-::\-Xml\-Document}!save\-File@{save\-File}}
\index{save\-File@{save\-File}!duye::XmlDocument@{duye\-::\-Xml\-Document}}
\subsubsection[{save\-File}]{\setlength{\rightskip}{0pt plus 5cm}bool duye\-::\-Xml\-Document\-::save\-File (
\begin{DoxyParamCaption}
\item[{F\-I\-L\-E $\ast$}]{file}
\end{DoxyParamCaption}
) const}}\label{classduye_1_1_xml_document_a8e022ad0b78af4b3229a96c0bd328477}


Save a file using the given F\-I\-L\-E$\ast$. Returns true if successful. 

S\-T\-L std\-::string version. \hypertarget{classduye_1_1_xml_document_ac7ccceb858268826e7fa0881dc58eb92}{\index{duye\-::\-Xml\-Document@{duye\-::\-Xml\-Document}!set\-Tab\-Size@{set\-Tab\-Size}}
\index{set\-Tab\-Size@{set\-Tab\-Size}!duye::XmlDocument@{duye\-::\-Xml\-Document}}
\subsubsection[{set\-Tab\-Size}]{\setlength{\rightskip}{0pt plus 5cm}void duye\-::\-Xml\-Document\-::set\-Tab\-Size (
\begin{DoxyParamCaption}
\item[{int}]{tabsize}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classduye_1_1_xml_document_ac7ccceb858268826e7fa0881dc58eb92}


Set\-Tab\-Size() allows the error reporting functions (Error\-Row() and Error\-Col()) to report the correct values for row and column. It does not change the output or input in any way. 

By calling this method, with a tab size greater than 0, the row and column of each node and attribute is stored when the file is loaded. Very useful for tracking the D\-O\-M back in to the source file.

The tab size is required for calculating the location of nodes. If not set, the default of 4 is used. The tabsize is set per document. Setting the tabsize to 0 disables row/column tracking.

Note that row and column tracking is not supported when using operator$>$$>$.

The tab size needs to be enabled before the parse or load. Correct usage\-: \begin{DoxyVerb}* GXmlDocument doc;
* doc.SetTabSize( 8 );
* doc.Load( "myfile.xml" );
* \end{DoxyVerb}


\begin{DoxySeeAlso}{See Also}
Row, Column 
\end{DoxySeeAlso}


The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Z\-:/duye/src/duyebase/utils/duye\-\_\-xml.\-h\end{DoxyCompactItemize}
